:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: KindCommand - a Javascript Library for WYSIWYG editor
:: Copyright (C) 2010 Longhao Luo
::
:: @site http://www.kindsoft.net/
:: @licence LGPL(http://www.opensource.org/licenses/lgpl-license.php)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

set VERSION=1.0
set SRC_DIR=src\
set KC_FILE=kindcommand.js
set TEMP_FILE=kindcommand.tmp

cls
@echo off
echo Building %KC_FILE%...
set DATE_STR=%date:/=%
set DATE_STR=%DATE_STR:~0,8%
setlocal enabledelayedexpansion
for /f "tokens=1* delims=:" %%i in ('findstr /n .* %SRC_DIR%\header.js') do (
	set START_STR=%%j
	if not !START_STR!.==. set START_STR=!START_STR:${VERSION}=%VERSION% ^(%DATE_STR%^)!
	echo on
	@echo.!START_STR! >> %TEMP_FILE%
	@echo off
)
endlocal
type %TEMP_FILE% > %KC_FILE%
del %TEMP_FILE%
type %SRC_DIR%\core.js >> %KC_FILE%
type %SRC_DIR%\string.js >> %KC_FILE%
type %SRC_DIR%\array.js >> %KC_FILE%
type %SRC_DIR%\node.js >> %KC_FILE%
type %SRC_DIR%\selector.js >> %KC_FILE%
type %SRC_DIR%\range.js >> %KC_FILE%
type %SRC_DIR%\doc.js >> %KC_FILE%
echo Build OK.
echo.
pause
